﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TarreOA.TarreOABLL;
using TarreOA.TarreOAModels;

public partial class Flow_Info_Search : System.Web.UI.Page {
    public List<FlowFront_WorkInfo> list = null;

    protected void Page_Load(object sender, EventArgs e) {
        FlowFront_WorkInfo_Service ffwi_service = new FlowFront_WorkInfo_Service();
        if("info_search".Equals(Request.Form.Get("state"))){
            string flowid = Request.Form.GetValues("FLOW_ID")[0];
            string prcstate = Request.Form.GetValues("FLOW_STATUS")[0];
            string relation = Request.Form.GetValues("WORK_NAME_RELATION")[0];
            string workName = Request.Form.Get("WORK_NAME");
            string startTime = Request.Form.Get("PRCS_DATE1");
            string endTime = Request.Form.Get("PRCS_DATE2");
            list = ffwi_service.SearchWorkByInfo(flowid, prcstate, relation, workName, startTime, endTime);
        } else if("field_search".Equals(Request.Form.Get("state"))) {
            int max = int.Parse(Request.Form.Get("max"));
            string[] data_array = new string[max];
            string[] reloation_array = new string[max];
            for(int i = 1; i <= max; i++) {
                data_array[i - 1] = Request.Form.GetValues("DATA_" + i)[0];
                reloation_array[i - 1] = Request.Form.GetValues("RELATION_" + i)[0];
            }
            list = ffwi_service.FindByFieldInfo(data_array, reloation_array);
        }
    }
}
